package com.snailhd.cloud.id.service.impl;

import com.snailhd.cloud.id.service.IdService;
import com.snailhd.cloud.id.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class IdServiceImpl implements IdService {

    @Resource
    SnowflakeIdWorker snowflakeIdWorker;

    @Override
    public String genId() {
        return String.valueOf(snowflakeIdWorker.nextId());
    }
}
